package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileCopyDemo02 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("img.png");
        FileOutputStream fos = new FileOutputStream("ing.png");

        int len;
        byte[] read = new byte[1024];
        while ((len=fis.read(read))!=-1){

            fos.write(read,0,len);

        }


    }
}
